package exception;

import java.io.FileOutputStream;
import java.io.IOException;

public class TryCatchDemo01 {
    public static void main(String[] args) {
     FileOutputStream fos = null;

       try {
        fos = new FileOutputStream("./fos.txt", true);
        fos.write("hello".getBytes());
        fos.close();
       } catch (Exception e1){
           e1.printStackTrace();
       }finally {
           if (fos!=null)try{
               fos.close();
               fos=null;
           }catch (IOException e){
               e.printStackTrace();
           }
       }

    }
}
